package ModelLayer;

import java.util.ArrayList;

/**
 * @author (Gruppe C) 
 * @version (2012.11.09)
 */
public class Person
{
    // Fields
    private long id;
    private String name;
    private String address;
    private String postalCode;
    private String city;
    private String phone;
    private static long nextNo = 0;

    /*
     * Person ctor
     * 
     * @param   id          ID assigned to person.
     * @param   address     Person's address.
     * @param   postalCode  Person's postal code.
     * @param   city        Person's city.
     * @param   phone       Person's phone number.
     */
    public Person(String name, String address, String postalCode, String city, String phone)
    {
        nextNo++;
        id = nextNo;
        this.name = name;
        this.address = address;
        this.postalCode = postalCode;
        this.city = city;
        this.phone = phone;
        
    }
    
    /*
     * Setters and getters:
     */
    public long getId()
    {
        return id;
    }
    public String getName()
    {
        return name;
    }
    public String getAddress()
    {
        return address;
    }
    public String getPostalCode()
    {
        return postalCode;
    }
    public String getCity()
    {
        return city;
    }
    public String getPhone()
    {
        return phone;
    }
    
    public void setName(String setName)
    {
        name = setName;
    }
    
    public void setAddress(String setAddress)
    {
       address = setAddress;
    }
    
    public void setPostalCode(String setPostalCode)
    {
        postalCode = setPostalCode;
    }
    
    public void setCity(String setCity)
    {
        city = setCity;
    }
    
    public void setPhone(String setPhone)
    {
        phone = setPhone;
    }
   
    /*
     * Print info about a person.
     */
    public void printPerson()
    {
        System.out.println("Id : "  + getId());
        System.out.println("Navn : " + getName());
        System.out.println("Adresse : " + getAddress());
        System.out.println("Postkode : " + getPostalCode());
        System.out.println("By : " + getCity());
        System.out.println("Tlf. : " + getPhone());
    }
}
